/* 逆置字符串 */
static void reverse(char* pString, int length)
{
    char* pStrEnd = pString + length - 1; /* 末尾 */
    char temp;
    while (pString < pStrEnd)
    {
        temp = *pString;
        *pString = *pStrEnd;
        *pStrEnd = temp;
        pString ++;
        pStrEnd --;
    }
}
char* utoa(unsigned int value, char* pStr, int radix)
{
    if (value == 0)
    {
        pStr[0] = '0';
        pStr[1] = '\0';
        return pStr;
    }
    if (radix <=0 || radix > 36) /* error */
    {
        pStr[0] = '\0';
        return pStr;
    }

    int i = 0;
    pStr[i++] = '\0';
    while (value != 0)
    {
        int remainder = value % radix;
        value /= radix;
        pStr[i++] = (remainder > 9) ? (remainder - 10) + 'A' : remainder + '0';
    }
    reverse(pStr, i);
    return pStr;
}
